package BookTest;

import java.util.Scanner;

public class G2Test {
    public static void main(String[] args) {

        try{
            double totalAmount=1023.79;
            Scanner sc=new Scanner(System.in);
            System.out.println("请输入取款金额：");
            int reduceAmount = sc.nextInt();
            double balance = totalAmount - (double)reduceAmount;
            System.out.println("余额："+balance);
        }
        catch(ArithmeticException e){
            System.out.println("输入的不是整数");
        }
        catch(Exception e){
            System.out.println("输入的不是整数");
        }
        finally{
            double totalAmount=1023.79;
            Scanner sc=new Scanner(System.in);
            System.out.println("请输入一个整数：");
            int reduceAmount = sc.nextInt();
            double balance = totalAmount - (double)reduceAmount;
            System.out.println("余额："+balance);
        }

    }
}
